package ws_client

import "net/http"

type ClientOptions struct {
	pattern string
	header  http.Header
}

type ClientOptionsFunc func(option *ClientOptions)

func newClientOption(fs ...ClientOptionsFunc) ClientOptions {
	opt := ClientOptions{
		pattern: "/ws",
		header:  nil,
	}

	for _, f := range fs {
		f(&opt)
	}
	return opt
}

// WithServerPattern 更改Pattern配置
func WithServerPattern(pattern string) ClientOptionsFunc {
	return func(opt *ClientOptions) {
		opt.pattern = pattern
	}
}

// WithServerHeader 更改Pattern配置
func WithServerHeader(header http.Header) ClientOptionsFunc {
	return func(opt *ClientOptions) {
		opt.header = header
	}
}
